nums = [3, 6, 10, 14, 2, 7]
for x in nums:
    num = nums.index(x)
    del nums[num]
    for y in nums:
        if x + y == 9:
            tuple1 = (x, y)
            list1 = list(tuple1)
            for i in list1:
                print(i,end=" ")